Export symbols needed by binder
authorBen Hutchings <ben@decadent.org.uk>
Mon, 5 Aug 2024 01:26:48 +0000 (03:26 +0200)
committerBen Hutchings <benh@debian.org>
Sat, 5 Oct 2024 23:00:02 +0000 (01:00 +0200)
Bug-Debian: https://bugs.debian.org/901492

We want to enable use of the Android binder driver to support
Waydroid, but it should not be built-in as that would waste resources
and increase security attack surface on systems that don't need it.

Export the currently un-exported symbols it depends on.

Gbp-Pq: Topic debian
Gbp-Pq: Name export-symbols-needed-by-android-drivers.patch

fs/file.c
ipc/msgutil.c
ipc/namespace.c
kernel/sched/syscalls.c
kernel/sched/wait.c
kernel/task_work.c
mm/memory.c
security/security.c

index 655338effe9c725574cf19e737a9384e7a460356..5ea2da97c22f195cbc0c22db78dd0a671f3873b9 100644 (file)
--- a/fs/file.c
+++ b/fs/file.c
@@ -819,6 +819,7 @@ struct file *file_close_fd(unsigned int fd)
 
        return file;
 }
+EXPORT_SYMBOL_GPL(file_close_fd);
 
 void do_close_on_exec(struct files_struct *files)
 {
index c7be0c79264767b74d6f3c716af16366034ceb1e..6306109822e447620813e29e8f6a53b569060a28 100644 (file)
@@ -33,6 +33,7 @@ struct ipc_namespace init_ipc_ns = {
        .ns.ops = &ipcns_operations,
 #endif
 };
+EXPORT_SYMBOL_GPL(init_ipc_ns);
 
 struct msg_msgseg {
        struct msg_msgseg *next;
index 6ecc30effd3ec6e875b1db39e85b6be76e5a0186..c06610467fdf50576e0b48194360259a43504cf3 100644 (file)
@@ -205,6 +205,7 @@ void put_ipc_ns(struct ipc_namespace *ns)
                        schedule_work(&free_ipc_work);
        }
 }
+EXPORT_SYMBOL_GPL(put_ipc_ns);
 
 static inline struct ipc_namespace *to_ipc_ns(struct ns_common *ns)
 {
index ae1b42775ef95c5f0ffc41d0491c4903f213db69..4f07af7ddb4501ccd705e0284bebec040c71aca6 100644 (file)
@@ -140,6 +140,7 @@ int can_nice(const struct task_struct *p, const int nice)
 {
        return is_nice_reduction(p, nice) || capable(CAP_SYS_NICE);
 }
+EXPORT_SYMBOL_GPL(can_nice);
 
 #ifdef __ARCH_WANT_SYS_NICE
 
index 51e38f5f47018c953e31c834dc6385c182359359..8b3547706b00a8e07363253f61f6d08e83ff966e 100644 (file)
@@ -212,6 +212,7 @@ void __wake_up_pollfree(struct wait_queue_head *wq_head)
        /* POLLFREE must have cleared the queue. */
        WARN_ON_ONCE(waitqueue_active(wq_head));
 }
+EXPORT_SYMBOL_GPL(__wake_up_pollfree);
 
 /*
  * Note: we use "set_current_state()" _after_ the wait-queue add,
index 5d14d639ac71b54a24dac49acd02f6c2c7e58e04..be74e1230b7b4dc5cc4347845e7b96c8c0ce8498 100644 (file)
@@ -97,6 +97,7 @@ int task_work_add(struct task_struct *task, struct callback_head *work,
 
        return 0;
 }
+EXPORT_SYMBOL_GPL(task_work_add);
 
 /**
  * task_work_cancel_match - cancel a pending work added by task_work_add()
index cda2c12c500b8d9f3594037a5fd5255f3d984c4c..045ca248f9139101293ff7f2488d84926c4924cf 100644 (file)
@@ -1934,6 +1934,7 @@ void zap_page_range_single(struct vm_area_struct *vma, unsigned long address,
        tlb_finish_mmu(&tlb);
        hugetlb_zap_end(vma, details);
 }
+EXPORT_SYMBOL_GPL(zap_page_range_single);
 
 /**
  * zap_vma_ptes - remove ptes mapping the vma
index 43166e341526c0046c749f5ba6af2cd9585cefe0..7e4537a3120a89efbe1f30c00cd4ad006d951342 100644 (file)
@@ -893,6 +893,7 @@ int security_binder_set_context_mgr(const struct cred *mgr)
 {
        return call_int_hook(binder_set_context_mgr, mgr);
 }
+EXPORT_SYMBOL_GPL(security_binder_set_context_mgr);
 
 /**
  * security_binder_transaction() - Check if a binder transaction is allowed
@@ -908,6 +909,7 @@ int security_binder_transaction(const struct cred *from,
 {
        return call_int_hook(binder_transaction, from, to);
 }
+EXPORT_SYMBOL_GPL(security_binder_transaction);
 
 /**
  * security_binder_transfer_binder() - Check if a binder transfer is allowed
@@ -923,6 +925,7 @@ int security_binder_transfer_binder(const struct cred *from,
 {
        return call_int_hook(binder_transfer_binder, from, to);
 }
+EXPORT_SYMBOL_GPL(security_binder_transfer_binder);
 
 /**
  * security_binder_transfer_file() - Check if a binder file xfer is allowed
@@ -939,6 +942,7 @@ int security_binder_transfer_file(const struct cred *from,
 {
        return call_int_hook(binder_transfer_file, from, to, file);
 }
+EXPORT_SYMBOL_GPL(security_binder_transfer_file);
 
 /**
  * security_ptrace_access_check() - Check if tracing is allowed